package com.dap.cms.governance.service.impl;

import com.dap.cms.governance.po.CmsComponentManagerPo;
import com.dap.cms.governance.po.CmsManagerPo;
import com.dap.cms.governance.service.CmsComponentManagerService;
import com.dap.cms.base.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
 * @description: t_cms_component_manager表对应的服务接口实现类
 * @author: Fesine
 * @createTime:2018/08/21
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2018/08/21
 */
@Service
public class CmsComponentManagerServiceImpl extends BaseServiceImpl<CmsComponentManagerPo>
        implements CmsComponentManagerService {
    @Override
    public void saveComponentIds(String componentIds,Integer managerId) {
        String[] idArray = componentIds.split(",");
        for (int i = 0; i <idArray.length; i++) {
            CmsComponentManagerPo cmsComponentManagerPo=new CmsComponentManagerPo();
            cmsComponentManagerPo.setManagerId(managerId);
            cmsComponentManagerPo.setComponentId(Integer.parseInt(idArray[i]));
            save(cmsComponentManagerPo);
        }
    }

}

